package com.k2data.k2app.mapper;

import com.k2data.k2app.domain.DeviceCond;
import com.k2data.k2app.domain.po.Customer;
import com.k2data.k2app.domain.po.DictPO;
import com.k2data.k2app.mybatis.mapper.K2Mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author lidong9144@163.com 17-3-15.
 */
@Mapper
@Repository
public interface CustomerMapper extends K2Mapper<Customer> {

    List<Customer> selectDeviceCustomers(DeviceCond cond);

    /**
     * 行业分组
     * @param cond
     * @return
     */
    List<Customer> selectIndustryCount(DeviceCond cond);


    List<Customer> selectDeviceCustomersByDate(DeviceCond cond);

    List<Customer> selectCustomerFault(DeviceCond cond);

    Customer selectByCustomerNo(String customerNo);

    @Select("SELECT customer_no AS 'label', customer_no AS 'value' FROM customer")
    List<DictPO> selectCustomerNoCondition();

    List<Customer> selectCustomerDevices();

    Integer selectCountMore(DeviceCond cond);

    /**
     * 查询插入的客户的最大id
     * @return
     */
    String selectCustomerNoMax();


}
